using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace WebShop.Contracts
{
    [Table("Orders")]
    public partial class Order
    {
        public Order()
        {
            this.Order_Details = new HashSet<Order_Detail>();
        }

        [Key]
        [ScaffoldColumn(false)]
        public int OrderID { get; set; }

        [ScaffoldColumn(false)]
        [ForeignKey("User")]
        public int? UserID { get; set; }

        //[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd.MM.yyyy}")]
        [DataType(DataType.Date)]
        public DateTime? OrderDate { get; set; }

        [DataType(DataType.Date)]
        public DateTime? RequiredDate { get; set; }

        [DataType(DataType.Date)]
        public DateTime? ShippedDate { get; set; }

        [ForeignKey("Shippers")]
        public Int32? ShipVia { get; set; }

        //[DisplayFormat(ApplyFormatInEditMode = false)]
        //[DataType(DataType.Currency)]
        //[Column(TypeName = "Money")]
        public Decimal? Freight { get; set; }

        [Required]
        [Display(Name = "Ship Name")]
        [StringLength(40, MinimumLength = 1)]
        public string ShipName { get; set; }

        [Required]
        public string ShipAddress { get; set; }

        [Required]
        public string ShipCity { get; set; }

        public string ShipRegion { get; set; }

        public string ShipPostalCode { get; set; }

        [Required]
        public string ShipCountry { get; set; }

        public virtual ICollection<Order_Detail> Order_Details { get; set; }
        public virtual Shipper Shippers { get; set; }
        public virtual User User { get; set; }
    }
}
